package com.example.demo.controller;

import com.example.demo.entity.Menu;
import com.example.demo.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class MenuController {

    @Autowired
    MenuService menuService;

    @ResponseBody
    @GetMapping("/getMenuList")
    public Map<String,Object> getMenuList(@RequestParam("menuType")String menuType){
        Map dataMap = new HashMap();
        List<Menu> dataList = menuService.getMenu(menuType);
        dataMap.put("status","0");
        dataMap.put("data",dataList);
        return  dataMap;
    }

}
